package day18;

import javax.security.sasl.SaslClient;
import java.util.Scanner;

public class demo3 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n= in.nextInt();
        int x= in.nextInt();
        int []arr=new int[n];
        for (int i = 0; i <n ; i++) {
            arr[i]=in.nextInt();
        }

        for(int i=0;i<n;i++){
            if(x>=arr[i])x=arr[i];
            else x=zhishu(x,arr[i]);
        }
        System.out.println(x);
    }

    public static int zhishu(int a,int b){
        while(b!=0){
            int t=b;
            b=a%b;
            a=t;
        }
        return a;
    }

}
